// WIP
//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_initgeardialog.sqf"
#include "x_setup.sqf"

#include "x_uiinc.sqf"

disableSerialization;

_disp = __uiGetVar(X_GEAR_DIALOG);

CTRL(6000) ctrlEnable false;
CTRL(7000) ctrlEnable false;

_ctrl = CTRL(1000);

_weap = primaryWeapon player;

if (_weap != "") then {
};

_lbidx = 0;
{
	_index = _ctrl lbAdd getText(configFile/"CfgWeapons"/_x/"displayName");
	_ctrl lbSetData [_index, _x];
	_pic = getText(configFile/"CfgWeapons"/_x/"picture");
	_ctrl lbSetPicture [_index, _pic];
	if (_x == _weap) then {
		_lbidx = _forEachIndex;
	};
} forEach [_weap, "arifle_TRG20_F"];

_ctrl lbSetCurSel _lbidx;